<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
<link rel="stylesheet" href="../../static/assets/css/zpui.css"/>
<link rel="stylesheet" href="../../static/assets/css/all.css"/>
<script src="../../static/assets/js/page.js"></script>

    <title> 云仓配货 </title>
</head>

<body>
<div class="page">
    <div class="page-hd">
        <div class="header bor-1px-b">
    <div class="header-left">
        <a href="javascript:history.go(-1)" class="left-arrow"></a>
    </div>
    <div class="header-title">云仓配货</div>
    <div class="header-right">
        <a href="#"></a>
    </div>
</div>
    </div>

    <div class="page-bd">
        <!-- 页面内容-->
        <div class="weui-cells card-box">
            <div class="weui-cell pb0 fs32">商品信息</div>
            <div class="weui-cell border-none">
                <div class="weui-cell__hd mr10">
                    <img src="/upload/gimg/2020/09/5f68609dd8f41_thumb.jpg" class="img140">
                </div>
                <div class="weui-cell__bd ">
                    <div class="fs28 ellipsisLn1">茅源庆典酒（云仓6瓶/箱）</div>
                    <div class="fs26 mt30">进货价：380</div>
                </div>
            </div>
        </div>
        <div class="weui-cells card-box">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <div>
                        <span class="fs28 fw600">用户ID</span>
                    </div>
                    <div class="tx_input search_input mt20">
                        <input class="weui-input" id="ID" type="number" oninput="retrieval()" placeholder="请输入用户ID">
                    </div>
                    
                    <div id="role_user" >
            
            
                    </div>
                    <div class="mt20">
                        <span class="fs28 fw600">配货数量</span>
                    </div>
                    <div class="tx_input  mt20">
                        <input class="weui-input" id="number" type="number" placeholder="请填写提配货数量">
                    </div>
                </div>
            </div>
        </div>
        <div class="weui-btn-area">
            <a href="javascript:;" class="weui-btn weui-btn_primary">确定</a>
        </div>
    </div>
</div>

<script src="../../static/assets/js/lib/jquery-2.1.4.js"></script>
<script src="../../static/assets/js/jquery-weui.min.js"></script>
<script src="../../static/assets/js/lib/fastclick.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
    });
</script>
<script>
    let GoodsID = "124"
    $('.weui-btn').on('click',function () {
        let ID = $('#ID').val();
        let number = $('#number').val();
        if(ID == ''){
            $.alert('请输入ID');
            return false;
        }
        if(!number || number == 0){
            $.alert('数量必须填写.');
            return;
        }
        if(number % 1 != 0){
            $.alert('数量必须填写整数.');
            return;
        }
        let data = {
            'userID': ID,
            'number':number,
            'goods_id':GoodsID
        }
        $.ajax({
            type:"POST",
            data:data,
            url:"/user/userapi/transferinventory.html",
            success:function (res) {
                $.alert(res.errmsg,function () {
                    window.location.href = res.url;
                })
            }
        })
    })
    
    function retrieval(){
        $.ajax({
            type:"POST",
            data:{'ID':$('#ID').val()},
            url:"/user/userapi/retrieval.html",
            success:function(res){
                $('#role_user').html(res);
            }
        })
    }
</script>
</body>
</html>